
/* shooting_game/frontend/css/animation.css */
/* 粉笔字书写动画 */
@keyframes chalk-writing {
  0% {
    stroke-dashoffset: 1000;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.chalk-text {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: chalk-writing 3s ease-in-out forwards;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

/* 黑板擦效果 */
@keyframes chalk-erase {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.chalk-erase {
  animation: chalk-erase 1s ease-out forwards;
}

/* 笔记本翻页效果 */
@keyframes page-flip {
  0% {
    transform: perspective(1000px) rotateY(0deg);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }
  50% {
    transform: perspective(1000px) rotateY(-90deg);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
  }
  100% {
    transform: perspective(1000px) rotateY(-180deg);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }
}

.page-flip {
  transform-origin: left center;
  animation: page-flip 1s ease-in-out forwards;
}

/* 校园元素浮动动画 */
@keyframes float-campus {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

.float-campus {
  animation: float-campus 3s ease-in-out infinite;
}

/* 彩色粉笔效果 */
@keyframes rainbow-chalk {
  0% {
    color: #ff6b6b;
  }
  20% {
    color: #ffbe0b;
  }
  40% {
    color: #4ecdc4;
  }
  60% {
    color: #45b7d1;
  }
  80% {
    color: #a37afc;
  }
  100% {
    color: #ff6b6b;
  }
}

.rainbow-chalk {
  animation: rainbow-chalk 5s linear infinite;
}

/* 作品卡片入场动画 */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: card-enter 0.5s ease-out forwards;
}

/* 按钮脉冲效果 */
@keyframes pulse-btn {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255,107,107,0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255,107,107,0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255,107,107,0);
  }
}

.pulse-btn {
  animation: pulse-btn 1.5s infinite;
}

/* 粒子效果增强 */
@keyframes particle-glow {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.3;
  }
}

.particle-glow {
  animation: particle-glow 2s ease-in-out infinite;
}

/* 校园铃铛动画 */
@keyframes bell-ring {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  50% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.bell-ring {
  transform-origin: top center;
  animation: bell-ring 0.5s ease-in-out infinite;
}

/* 笔记本线条动画 */
@keyframes line-draw {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.line-draw {
  animation: line-draw 1s ease-out forwards;
}
